# $Id: PKGBUILD 150376 2012-02-17 09:55:00Z allan $
# Maintainer: Jan de Groot <jgc@archlinux.org>

pkgname=xorg-fonts-type1
pkgver=7.4
pkgrel=2
pkgdesc="X.org Type1 fonts"
arch=(any)
license=('custom')
url="http://xorg.freedesktop.org/"
depends=(xorg-fonts-encodings xorg-fonts-alias xorg-font-utils fontconfig)
install=xfonts.install
source=(${url}/releases/individual/font/font-adobe-utopia-type1-1.0.2.tar.bz2
        ${url}/releases/individual/font/font-bh-type1-1.0.1.tar.bz2
        ${url}/releases/individual/font/font-bitstream-type1-1.0.1.tar.bz2
        ${url}/releases/individual/font/font-ibm-type1-1.0.1.tar.bz2
        ${url}/releases/individual/font/font-xfree86-type1-1.0.2.tar.bz2)
md5sums=('ad945b19b2db64dec3a19507848ff63b'
         '374d954c61363206c93d1ce7e9445c31'
         'a4e8e229a051c0ede9eb525e4006d93a'
         '1646179ff224b3e2c9b1e7f59042897f'
         'a966f5a8aade9e63af86d8a6bf3e8586')

build() {
  cd "${srcdir}"
  for dir in *; do
    if [ -d "${dir}" ]; then
      pushd "${dir}"
      ./configure --prefix=/usr \
        --with-fontdir=/usr/share/fonts/Type1
      make
      popd
    fi
  done
}

package() {
  cd "${srcdir}"
  install -m755 -d "${pkgdir}/usr/share/licenses/${pkgname}"
  for dir in *; do
    if [ -d "${dir}" ]; then
      pushd "${dir}"
      make DESTDIR="${pkgdir}" install
      install -m644 COPYING "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE.${dir%-*}"
      popd
    fi
  done
  rm -f "${pkgdir}"/usr/share/fonts/Type1/fonts.*
}
